package com.itheima.crops.pojo;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "t_pcrops_index", schema = "farm", catalog = "")
public class PcropsIndex {
    private Long id;
    private Long cid;
    private Long iid;
    private String suit;

    @Id
    @Column(name = "id")
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Basic
    @Column(name = "cid")
    public Long getCid() {
        return cid;
    }

    public void setCid(Long cid) {
        this.cid = cid;
    }

    @Basic
    @Column(name = "iid")
    public Long getIid() {
        return iid;
    }

    public void setIid(Long iid) {
        this.iid = iid;
    }

    @Basic
    @Column(name = "suit")
    public String getSuit() {
        return suit;
    }

    public void setSuit(String suit) {
        this.suit = suit;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        PcropsIndex that = (PcropsIndex) o;
        return id == that.id &&
                Objects.equals(cid, that.cid) &&
                Objects.equals(iid, that.iid) &&
                Objects.equals(suit, that.suit);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, cid, iid, suit);
    }
}
